#ifndef DATABASEMANAGER_H
#define DATABASEMANAGER_H

#include <list>
#include <map>
#include <string>
#include "Client.hpp"

class DatabaseManager
{
 public:
  void loadDatabase();
  std::map<std::string, Client*> &getClients() { return _clients; }
  void addClient(Client *clt) { _clients[clt->getLogin()] = clt; }
  bool clientExist(const std::string &login);
  bool loginMatchPass(const std::string &login, const std::string &pass);
  Client *getClientByLogin(const std::string &login);
 private:
  std::map<std::string, Client*> _clients;
  void loadOneContact(const std::string &filename);
};

#endif
